package com.demo2do.boyle.common.entity.customer.social;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author Wilson
 */
@Alias("socialType")
public enum SocialType {

    WECHAT("微信", "icon-wechat"),
    SINA_WEIBO("新浪微博", "icon-sina");

    private String description;
    
    private String logo;

    SocialType(String description, String logo) {
        this.description = description;
        this.logo = logo;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the logo
     */
    public String getLogo() {
        return logo;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @param logo the logo to set
     */
    public void setLogo(String logo) {
        this.logo = logo;
    }

    @Override
    public String toString() {
        return this.description;
    }
    
    /**
     * 
     * @param name
     * @return
     */
    public static SocialType aliasOf(String name) {
		for(SocialType socialType : SocialType.values()) {
			if(socialType.getDescription().equalsIgnoreCase(name)) {
				return socialType;
			}
		}
		return null;
	}
    
    /**
     * 
     * @return name
     */
    public String getName() {
        return name();
    }

}
